<template>
    <div class="tabs">
        <el-tabs type="card" @tab-click="handleClick">
            <el-tab-pane label="首页" name="first"></el-tab-pane>
            <el-tab-pane label="房产经纪" name="second"></el-tab-pane>
            <el-tab-pane label="地产分类" name="third"></el-tab-pane>
            <el-tab-pane label="关于我们" name="fourth"></el-tab-pane>
        </el-tabs>
        <router-view />
    </div>

</template>
<script>

export default {
    data() {
        return {
        };
    },
    methods: {
        handleClick(tab, event) {
            if (tab.name === "first") {
                this.$router.push('/')
            } else if (tab.name === 'second') {
                this.$router.push('/agent')
            }
            else if (tab.name === 'third') {
                this.$router.push('/category')
            }
            else if (tab.name === 'fourth') {
                this.$router.push('/regards')
            }
        }
    }
}; 
</script>

<style scoped>

</style>